Scientific Linux 6
Sponsored Link

Pacemaker - Install
2011/06/18
 
Install Linux High-Availability Cluster tool "Pacemaker".
This example shows to configure on the environment like follows.
(1)  www01.srv.world  ( eth0 [192.168.1.60],  eth1 [10.0.0.60] )
(2)  www02.srv.world  ( eth0 [192.168.1.61],  eth1 [10.0.0.61] )
This example uses eth0 for inter-connection and uses eth1 for service provider.
[1] Install Pacemaker on both Hosts.
[root@www01 ~]#
yum -y install pacemaker
[2] Create an authkeys that is used for inter-connection. Configure it on both Hosts.
[root@www01 ~]#
vi /etc/ha.d/authkeys
auth 1
1 sha1 secret
[root@www01 ~]#
chmod 600 /etc/ha.d/authkeys

[3] Configure Corosync on both Hosts.
[root@www01 ~]#
cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf

[root@www01 ~]#
vi /etc/corosync/corosync.conf
compatibility: whitetank
# add like follows.

aisexec {
        user: root
        group: root
}
service {
        name: pacemaker
        ver: 0
        use_mgmtd: yes
}
totem {
        version: 2
        secauth: off
        threads: 0
        interface {
                ringnumber: 0
# Specify network address for inter-connection

                bindnetaddr: 192.168.1.0
                mcastaddr: 226.94.1.1
                mcastport: 5405
        }
}
logging {
        fileline: off
        to_stderr: no
        to_logfile: yes
        to_syslog: yes
        logfile: /var/log/cluster/corosync.log
        debug: off
        timestamp: on
        logger_subsys {
                subsys: AMF
                debug: off
        }
}
amf {
        mode: disabled
}

[root@www01 ~]#
chown -R hacluster. /var/log/cluster

[root@www01 ~]#
/etc/rc.d/init.d/corosync start

Starting Corosync Cluster Engine (corosync): [ OK ]
[root@www01 ~]#
chkconfig corosync on

[4] Execute crm_mon on a Host, then it's OK if the result like follows is shown. Basic settings is done for Pacemaker. It's necessarry to configure more if you'd like to configure a service as Cluster. See next Step.
[root@www01 ~]#
crm_mon

============
Last updated: Sat Jun 18 18:01:18 2011
Stack: openais
Current DC: www01.srv.world - partition with quorum
Version: 1.1.2-f059ec7ced7a86f18e5490b67ebf4a0b963bccfe
2 Nodes configured, 2 expected votes
0 Resources configured.
============

Online: [ www01.srv.world www02.srv.world ]

[root@www01 ~]#
crm configure property no-quorum-policy="ignore" stonith-enabled="false"

[root@www01 ~]#
crm configure rsc_defaults resource-stickiness="INFINITY" migration-threshold="1"
[5] If you'd like to clear all settings of pacemaker, Do like follows.
[root@www01 ~]#
/etc/rc.d/init.d/corosync stop
# stop

[root@www01 ~]#
rm -f /var/lib/heartbeat/crm/*
# remove all

[root@www01 ~]#
/etc/rc.d/init.d/corosync start
# start

 
Tweet